<template>
<Row>
    <Col>
        <main-phone>
			<div slot="menu">
				<slot name="phone-menu"></slot>
			</div>
			<div slot="content">
				<slot name="content"></slot>
			</div>
		</main-phone>
    </Col>
</Row>
</template>

<script lang="ts">
import { Component, Vue,Inject, Prop,Watch } from 'vue-property-decorator';
import AbpBase from '../lib/abpbase'
import MainClient from './main-client.vue'
import MainPhone from './main-phone.vue'
import Util from '../lib/util';

@Component({
    components: { MainClient, MainPhone }
})
export default class Main extends AbpBase{
	get index() {
		return this.$store.state.websiteInfo.homeIndex;
	}
	async getSelf() {
		await this.$store.dispatch('self/getSelf');
	}
	async handleGetFooter() {
		await this.$store.dispatch('websiteInfo/getHomeFooter');
	}
	async created() {
		Util.setCurrentPath(this, this.$route.name);
		if(this.isLogined) {
			await this.getSelf();
		}
		await this.handleGetFooter();
	}
	@Watch('$route')
	handleOnRouteChange() {
		Util.setCurrentPath(this, this.$route.name);
	}
}
</script>

